﻿@page "/color-picker"
@inject IStringLocalizer<ColorPickers> Localizer

<h3>@Localizer["Title"]</h3>

<h4>@Localizer["Description"]</h4>

<DemoBlock Title="@Localizer["NormalTitle"]" Introduction="@Localizer["NormalIntro"]" Name="Normal">
    <ColorPicker Value="@Value" OnValueChanged="@OnColorChanged" />
    <ConsoleLogger @ref="NormalLogger" class="mt-3" />
</DemoBlock>

<DemoBlock Title="@Localizer["ValueTitle"]" Introduction="@Localizer["ValueIntro"]" Name="Value">
    <p>@((MarkupString)Localizer["ValueDescription"].Value)</p>
    <ColorPicker Value="@Value" />
</DemoBlock>

<DemoBlock Title="@Localizer["BindValueTitle"]" Introduction="@Localizer["BindValueIntro"]" Name="BindValue">
    <ColorPicker @bind-Value="@Value" />
    <div class="mt-3">Value: @Value</div>
</DemoBlock>

<DemoBlock Title="@Localizer["DisabledTitle"]" Introduction="@Localizer["DisabledIntro"]" Name="Disabled">
    <ColorPicker Value="@Value" IsDisabled="true" />
</DemoBlock>

<DemoBlock Title="@Localizer["ValidateFormTitle"]" Introduction="@Localizer["ValidateFormIntro"]" Name="ValidateForm">
    <ValidateForm Model="Dummy">
        <div class="row g-3 form-inline">
            <div class="col-6">
                <ColorPicker @bind-Value="@Dummy.Name" />
            </div>
        </div>
    </ValidateForm>
</DemoBlock>

<AttributeTable Items="@GetAttributes()" />
